package com.demo.jianjunhuang.activitylifecycle;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 * @author jianjunhuang.me@foxmail.com
 * @since 2017/5/20.
 */

public class FirstActivity extends AppCompatActivity {

  private Button btn_second;

  @Override protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_first);
    btn_second = (Button) findViewById(R.id.btn_second);
    btn_second.setOnClickListener(new OnClickListener() {
      @Override public void onClick(View v) {
        Intent intent = new Intent(FirstActivity.this, SecondActivity.class);
        startActivity(intent);
      }
    });
  }
}
